package com.xiaoxing.zhinenghuacangku_jining.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.zhinenghuacangku_jining.R;
import com.xiaoxing.zhinenghuacangku_jining.mvp.model.entity.JiNing_GetReturnGoodMeterTask;

import java.util.List;


public class JiNing_JianXiuRuKuAdapter extends BaseQuickAdapter<JiNing_GetReturnGoodMeterTask, BaseViewHolder> {

    private Context mContext;
    private IJianXiuRuKuAdapter mIJianXiuRuKuAdapter;

    public JiNing_JianXiuRuKuAdapter(Context context, @Nullable List<JiNing_GetReturnGoodMeterTask> data, IJianXiuRuKuAdapter iJianXiuRuKuAdapter) {
        super(R.layout.zhi_neng_cang_ku_ji_ning_item_jian_xiu_ru_ku, data);
        this.mContext = context;
        this.mIJianXiuRuKuAdapter = iJianXiuRuKuAdapter;
    }

    @Override
    protected void convert(BaseViewHolder helper, JiNing_GetReturnGoodMeterTask item) {
//        GlideUtil.loadImage(mContext, item.getImg(), helper.getView(R.id.img_product));
        //elecequipmenttype nvarchar(50),--设备类别
        //elecmeterclass nvarchar(50),--电表类别
        //elecmetertype nvarchar(50),--电表类型
        //commtype nvarchar(50),--通讯方式
        //displaytype nvarchar(50),--显示方式
        //volume nvarchar(50),--容量
        //elecpress nvarchar(50),--电压
        //connmode nvarchar(50),--接线方式
        //noworkgrade nvarchar(30),--无功等级
        //workgrade nvarchar(30),--有功等级
        //model nvarchar(50),--型号
        //isfufeilv int,--是否复费率
        //isyufufei int,--是否预付费
        helper.setText(R.id.tv_wu_liao_id, item.getMid());
        helper.setText(R.id.tv_tong_xun_fang_shi, item.getCommtype());
        helper.setText(R.id.tv_xian_shi_fang_shi, item.getDisplaytype());
        helper.setText(R.id.tv_rong_liang, item.getVolume());
        helper.setText(R.id.tv_dian_ya, item.getElecpress());
        helper.setText(R.id.tv_jie_xian_fang_shi, item.getConnmode());
        helper.setText(R.id.tv_wu_gong_deng_ji, item.getNoworkgrade());
        helper.setText(R.id.tv_you_gong_deng_ji, item.getWorkgrade());
        helper.setText(R.id.tv_xing_hao, item.getModel());
        helper.setText(R.id.tv_shi_fou_fu_fei_lv, item.getIsfufeilv());
        helper.setText(R.id.tv_shi_fou_yu_fu_fei, item.getIsyufufei());
        helper.setOnClickListener(R.id.btn_que_ding_ru_ku, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mIJianXiuRuKuAdapter.queDingRuKu(item);
            }
        });
    }

    public interface IJianXiuRuKuAdapter {
        void queDingRuKu(JiNing_GetReturnGoodMeterTask item);
    }

}
